import request from '@/utils/request';
import { getPageSize } from '@/utils/common';

export async function insuranceList(params) {
  params.pageSize = params.pageSize || getPageSize();
  return request(`/server/api/tms/tms-insurance/selectList`, {
    method: 'POST',
    body: params,
  });
}

export async function insuranceDetail(params) {
  return request(`/server/api/tms/tms-insurance/selectDetails`, {
    method: 'POST',
    body: params,
  });
}

export async function insuranceAdd(params) {
  return request(
    `/server/api/tms/tms-insurance/insertInsurance`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}

export async function insuranceEdit(params) {
  return request(
    `/server/api/tms/tms-insurance/updateInsurance`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
export async function carList(params) {
  return request(
    `/server/api/tms/tms-insurance/selectInsuranceVehicle`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
/**
 * 生成账单
 */
export async function generatedBills(params) {
  return request(`/server/api/tms/tms-insurance/generateBill`, {
    method: 'POST',
    body: params,
  });
}

export async function deleteInsurance(params) {
  return request(`/server/api/tms/tms-insurance/deleteTmsInsurance`, {
    method: 'POST',
    body: params,
  });
}

export async function selectAll(params) {
  return request(`/server/api/tms/tms-insurance/generateBillByCheckAll`, {
    method: 'POST',
    body: params,
  });
}
